export const tableColumns = [
<#list fieldData as item>
    <#assign fieldShowName = item.fieldShowName>
    <#assign fieldName = item.dbFieldName>
    <#assign fieldShowType = item.fieldShowType>
    <#assign isQuery = item.isQuery>
    <#assign isShowList = item.isShowList>
    <#assign dictOriginType = item.dictOriginType>
    <#assign dictKey = item.dictKey>
    <#if isShowList == true && fieldShowType?has_content>
        <#switch fieldShowType>
        <#--            // 文本框-->
            <#case "1">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'text',
                    matchType: 'contain',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    minWidth: 120,
                    sortAble: 1,
                    formatter: ({cellValue, row}) => {
                        return cellValue || '--';
                    }
                },
                <#break>
            <#--                // 单选框-->
            <#case "2">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: <#if dictOriginType == "1">'dict'<#elseif dictOriginType == "2">'select'<#else>'select'</#if>,
                    matchType: 'equal',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    minWidth: 120,
                    sortAble: 1,
                    options:{
                        <#if dictOriginType == "1"><#assign dictCode = item.dictField>dictCode: '${dictCode}',</#if>
                        <#if dictOriginType == "2">options: [],</#if>
                    },
                    formatter: ({cellValue, row}) => {
                        return <#if dictOriginType == "1">row.${fieldName}_dictText<#elseif dictOriginType == "2">row.${fieldName}_realText<#else>cellValue</#if> || '--';
                    }
                },
                <#break>
            <#--                // 多选框-->
            <#case "3">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: <#if dictOriginType == "1">'multipleDict'<#elseif dictOriginType == "2">'multipleSelect'<#else>'select'</#if>,
                    matchType: 'contain',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 150,
                    options: {
                        mode: "multiple",
                        <#if dictOriginType == "1"><#assign dictCode = item.dictField>dictCode: '${dictCode}',</#if>
                        <#if dictOriginType == "2">options: [],</#if>
                    },
                    formatter: ({cellValue, row}) => {
                                return <#if dictOriginType == "1">row.${fieldName}_dictText<#elseif dictOriginType == "2">row.${fieldName}_realText<#else>cellValue</#if> || '--';
                    }
                },
                <#break>
             <#--                // 日期(yyyy-MM-dd)-->
            <#case "5">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'dateRange',
                    matchType: 'range',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 120,
                    formatter: ({cellValue, row}) => {
                            return cellValue || '--';
                    }
                },
                <#break>
            <#--                // 日期(yyyy)-->
            <#case "6">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'text',
                    matchType: 'contain',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 100,
                    formatter: ({cellValue, row}) => {
                            return cellValue || '--';
                    }
                },
                <#break>
                <#case "7">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'dateTimeRange',
                    matchType: 'range',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 150,
                    formatter: ({cellValue, row}) => {
                            return cellValue || '--';
                    }
                },
            <#break>
            <#--                // 多行文本-->
            <#case "8">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'text',
                    matchType: 'contain',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 150,
                    formatter: ({cellValue, row}) => {
                            return cellValue || '--';
                    }
                },
                <#break>
            <#--                // 下拉框-->
            <#case "10">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: <#if dictOriginType == "1">'dict'<#elseif dictOriginType == "2">'select'<#else>'select'</#if>,
                    matchType: 'equal',
                    options: {
                        <#if dictOriginType == "1"><#assign dictCode = item.dictField>dictCode: '${dictCode}',</#if>
                        <#if dictOriginType == "2">options: [],</#if>
                    },
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                     minWidth: 120,
                    formatter: ({cellValue, row}) => {
                        return <#if dictOriginType == "1">row.${fieldName}_dictText<#elseif dictOriginType == "2">row.${fieldName}_realText<#else>cellValue</#if> || '--';
                    }
                },
                <#break>
            <#--                // 下拉多选-->
            <#case "11">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: <#if dictOriginType == "1">'multipleDict'<#elseif dictOriginType == "2">'multipleSelect'<#else>'select'</#if>,
                    matchType: 'contain',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 150,
                    options: {
                        mode: "multiple",
                        <#if dictOriginType == "1"><#assign dictCode = item.dictField>dictCode: '${dictCode}',</#if>
                        <#if dictOriginType == "2">options: [],</#if>
                    },
                    formatter: ({cellValue, row}) => {
                                return <#if dictOriginType == "1">row.${fieldName}_dictText<#elseif dictOriginType == "2">row.${fieldName}_realText<#else>cellValue</#if> || '--';
                    }
                },
                <#break>
            <#--                // 数值-->
            <#case "12">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    dataIndex: '${fieldName}',
                    key: '${fieldName}',
                    dataType: 'number',
                    matchType: 'equal',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                    minWidth: 100,
                    formatter: ({cellValue, row}) => {
                            return cellValue;
                    }
                },
                <#break>
            <#--                // 人员选择-->
            <#case "13">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'select',
                    matchType: 'equal',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    minWidth: 100,
                    sortAble: 1,
                    options: {
                        options:[]
                    },
                    formatter: ({cellValue, row}) => {
                            return row.${fieldName}_realText || '--';
                    }
                },
                <#break>
            <#--                // 部门选择-->
            <#case "14">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'select',
                    matchType: 'equal',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    minWidth: 120,
                    sortAble: 1,
                    options: {
                        options:[]
                    },
                    formatter: ({cellValue, row}) => {
                            return row.${fieldName}_realText || '--';
                    }
                },
                <#break>
                <#case "15">
                {
                    title: '${fieldShowName}',
                    align: 'center',
                    key: '${fieldName}',
                    dataType: 'userDict',
                    matchType: 'equal',
                    defaultSearchFlag: <#if isQuery>1<#else>0</#if>,
                    searchFlag: <#if isQuery>1<#else>0</#if>,
                    sortAble: 1,
                     minWidth: 120,
                    formatter: ({cellValue, row}) => {
                        return row.${fieldName}_dictText;
                    }
                },
                <#break>
        </#switch>
    </#if>

</#list>
{
        title: '操作',
        align: 'center',
        key: 'actions',
        width: 100,
        fixed: 'right',
        slots: {
            default: 'actions'
        }
    },
];



export const formOptions = [
  { type: "a-input", key: 'id', hidden: true },
                    <#list fieldData as item>
                    <#assign fieldName = item.dbFieldName>
                    <#assign fieldShowName = item.fieldShowName>
                    <#assign isShowList = item.isShowList>
                    <#assign isShowForm = item.isShowForm>
                    <#assign fieldShowType = item.fieldShowType>
                    <#assign fieldMustInput = item.fieldMustInput>
                    <#assign dictOriginType = item.dictOriginType>
                    <#assign dictKey = item.dictKey>
                    <#assign dictCode = item.dictField>
                    <#if isShowForm == true && fieldShowType?has_content>
                    <#switch fieldShowType>
                    <#--            // 文本框-->
                    <#case "1">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: "a-input",
                        <#if fieldMustInput == true>
                        rules: [{ required: true, message: '请输入${fieldShowName}' }],
                        </#if>
                        options: {
                            props: {
                                placeholder: '请输入${fieldShowName}',
                            }
                        },
                    },
                    <#break>
                    <#-- 单选框-->
                        <#case "2">
                        <#if dictOriginType == "1">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-dict-radio',
                                <#if fieldMustInput == true>
                                rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        dictCode: "${dictCode}",
                                    },
                                },
                            },
                        </#if>
                        <#if dictOriginType == "2">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-radio',
                                <#if fieldMustInput == true>
                                rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props:{
                                        options: [],
                                    },
                                },
                            },
                            </#if>
                            <#break>
                    <#--                // 多选框-->
                    <#-- // 多选框-->
                    <#case "3">
                        <#if dictOriginType == "1">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-dict-checkbox',
                                <#if fieldMustInput == true>
                                rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        dictCode: "${dictCode}",
                                        options: [],
                                    },
                                },
                            },
                        </#if>
                        <#if dictOriginType == "2">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-checkbox',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        options: [],
                                    }
                                },
                            },
                        </#if>
                    <#break>
                    <#--                // 日期(yyyy-MM-dd)-->
                    <#case "5">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: 'h-date-picker',
                        <#if fieldMustInput == true>
                        rules: [{ required: true, message: '请选择${fieldShowName}' }],
                        </#if>
                        options: {
                            props: {
                                format:"YYYY-MM-DD",
                                valueFormat:"YYYY-MM-DD",
                                placeholder: "请选择${fieldShowName}",
                            }
                        },
                    },
                    <#break>
                    <#--                // 日期(yyyy)-->
                    <#case "6">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: 'h-year-picker',
                        <#if fieldMustInput == true>
                            rules: [{ required: true, message: '请选择${fieldShowName}' }],
                        </#if>
                        options: {
                            props:{
                                placeholder: "请选择${fieldShowName}",
                            }
                        },
                    },
                    <#break>
                    <#--                // 日期(yyyy-MM-dd HH:mm:ss)-->
                    <#case "7">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: 'h-date-picker',
                        <#if fieldMustInput == true>
                        rules: [{ required: true, message: '请选择${fieldShowName}' }],
                        </#if>
                        options: {
                            props: {
                                showTime: true,
                                format:"YYYY-MM-DD HH:mm:ss",
                                valueFormat:"YYYY-MM-DD HH:mm:ss",
                                placeholder: "请选择${fieldShowName}",
                            }
                        },
                    },
                    <#break>
                    <#--                // 多行文本-->
                    <#case "8">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: 'a-textarea',
                        span: 2,
                        <#if fieldMustInput == true>
                        rules: [{ required: true, message: '请输入${fieldShowName}' }],
                        </#if>
                        options: {
                            props: {
                                placeholder: '请输入${fieldShowName}',
                            }
                        },
                    },
                    <#break>
                    <#--                // 文件-->
                    <#case "9">
                    {
                        title: '${fieldShowName}',
                        key: '${fieldName}',
                        type: 'h-upload-file',
                        span: 2,
                        <#if fieldMustInput == true>
                        rules: [{ required: true, message: '请上传${fieldShowName}' }],
                        </#if>
                        options: {
                            props: {
                                  showSecretLevel: true,
                            },
                            scopedSlots: {
                                secretLevel: ({row, $upload}) => this.$createElement("h-dict-select-user", {
                                    props: {
                                        value: row.secretLevel,
                                    },
                                    on: {
                                        change: (value) => {
                                            row.secretLevel = value;
                                            $upload.triggerChange();
                                        },
                                    },
                                }),
                            },
                        },
                    },
                    <#break>
                    <#--                // 下拉框-->
                        <#case "10">
                        <#if dictOriginType == "1">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-dict-select',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        dictCode: "${dictCode}",
                                        options: [],
                                    }
                                },
                            },
                        </#if>
                        <#if dictOriginType == "2">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-select',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        options: [],
                                    }
                                },
                            },
                        </#if>
                            <#break>
                        <#--                // 下拉多选-->
                        <#case "11">
                        <#if dictOriginType == "1">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-dict-select',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        mode: "multiple",
                                        dictCode: "${dictCode}",
                                        options: [],
                                    }
                                },
                            },
                        </#if>
                        <#if dictOriginType == "2">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-select',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        mode: "multiple",
                                        options: [],
                                    }
                                },
                            },
                        </#if>
                            <#break>
                        <#--                // 数值-->
                        <#case "12">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'a-input-number',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请输入${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        placeholder: '请输入${fieldShowName}',
                                    },
                                    style:{
                                        width: "100%"
                                    }
                                },
                            },
                            <#break>
                        <#--                // 人员选择-->
                        <#case "13">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'sysUserSelect',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        placeholder: `请选择${fieldShowName}`,
                                    }
                                }   
                            },
                            <#break>
                        <#--                // 部门选择-->
                        <#case "14">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'HDepartSelect',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        placeholder: `请选择${fieldShowName}`,
                                    }
                                },
                            },
                            <#break>
                            <#--                // 人员密级选择-->
                        <#case "15">
                            {
                                title: '${fieldShowName}',
                                key: '${fieldName}',
                                type: 'h-dict-select-user',
                                <#if fieldMustInput == true>
                                    rules: [{ required: true, message: '请选择${fieldShowName}' }],
                                </#if>
                                options: {
                                    props: {
                                        placeholder: `请选择${fieldShowName}`,
                                    }
                                },
                            },
                            <#break>
                    </#switch>
                    </#if>
                    </#list>
]
